﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UCSanPhamTheoNhom.ascx.cs"
    Inherits="UControl_UCSanPhamTheoNhom" %>
<%--<script src="../Scripts/fancybox/jquery-1.4.3.min.js" type="text/javascript"></script>
<script src="../Scripts/fancybox/jquery.fancybox-1.3.4.pack.js" type="text/javascript"></script>
<script src="../Scripts/fancybox/jquery.mousewheel-3.0.4.pack.js" type="text/javascript"></script>
<link href="../Scripts/fancybox/jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
    $(document).ready(function () {
        $("a#example1").fancybox();

        $("a#example2").fancybox({
            'overlayShow': false,
            'transitionIn': 'elastic',
            'transitionOut': 'elastic'
        });

        $("a#example3").fancybox({
            'transitionIn': 'none',
            'transitionOut': 'none'
        });

        $("a#example4").fancybox({
            'opacity': true,
            'overlayShow': false,
            'transitionIn': 'elastic',
            'transitionOut': 'none'
        });

        $("a#example5").fancybox();

        $("a#example6").fancybox({
            'titlePosition': 'outside',
            'overlayColor': '#000',
            'overlayOpacity': 0.9
        });

        $("a#example7").fancybox({
            'titlePosition': 'inside'
        });

        $("a#example8").fancybox({
            'titlePosition': 'over'
        });

    });

    $("a[rel=example_group]").fancybox({
        'transitionIn': 'none',
        'transitionOut': 'none',
        'titlePosition': 'over',
        'titleFormat': function (title, currentArray, currentIndex, currentOpts) {
            return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
        }
    });
	</script>--%>
<div>
    <div style="padding: 5px; height: 20px; color: #4c4c4c; font-weight: bold;">
        <asp:Label ID="lblTieuDe" runat="server" Text="Label"></asp:Label>
    </div>
    <asp:ListView ID="lvwSanPham" runat="server" DataSourceID="EntityDataSource1" GroupItemCount="3"
        DataKeyNames="SanPhamID">
        <GroupTemplate>
            <tr id="itemPlaceholderContainer" runat="server">
                <td id="itemPlaceholder" runat="server">
                </td>
            </tr>
        </GroupTemplate>
        <ItemTemplate>
            <td id="Td1" runat="server" align="center" style="padding-top: 15px;">
                <asp:HyperLink ForeColor="#4c4c4c" ID="HyperLink1" runat="server" NavigateUrl='<%# "~/Pages/SanPhamCT.aspx?idSP="+Eval("SanPhamID") %>'>
                    <asp:Image BorderColor="#E3E3E3" BorderStyle="Solid" BorderWidth="1px" Height="260px"
                        ID="hinh" runat="server" ImageUrl='<%# "~/Photos/SanPham/"+Eval("Hinh") %>' Width="230px" /></asp:HyperLink><br />
                <asp:HyperLink ForeColor="#4c4c4c" ID="tenSanPham" runat="server" Text='<%# Eval("TenSanPham") %>'
                    NavigateUrl='<%# "~/Pages/SanPhamCT.aspx?idSP="+Eval("SanPhamID") %>' CssClass="LinkSanPham"></asp:HyperLink>
                <div class="alignR">
                    <table border="0" width="200px">
                        <tr>
                            <td style="font-size: 11.5px;" align="left">
                                <%# (Eval("MoTa") != null) ? ((Eval("MoTa").ToString().Length > 50) ? Eval("MoTa").ToString().Substring(0, 50) + "..." : Eval("MoTa").ToString()) : ""%></b>
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 15px;" align="left">
                                <%# (Eval("KhuyenMai") != null) ? "<span style='text-decoration: line-through; font-size:12px;'>USD: " : "<span style='color: #f23f7a; font-size:12px; font-weight:Bold;'>USD: "%>
                                <%# Eval("DonGia") %>
                                <%#  "</span>" %>
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 15px; padding: 0xp" align="left">
                                <%# (Eval("KhuyenMai") != null) ? "<span style='color: #f23f7a;font-size:12px;font-weight:Bold; padding:0px;'>USD:" : ""%>
                                <%# (Eval("KhuyenMai") != null) ? Eval("KhuyenMai") : "" %>
                                <%# (Eval("KhuyenMai") != null) ? "</span>" : "" %>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
                                    <ContentTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" OnClick="DatHang_Click" TabIndex='<%# int.Parse(Eval("SanPhamID").ToString()) %>'>
                                                                    <img alt='<%# Eval("SanPhamID") %>'  src="../Images/addcart.gif" width="90" height="30"
                                onmouseover="this.style.cursor='pointer'" onmouseout="this.style.cursor='auto'"
                                title="Chon mua hang" />
                                        </asp:LinkButton>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                        </tr>
                    </table>
                </div>
            </td>
        </ItemTemplate>
        <LayoutTemplate>
            <table id="Table1" runat="server" style="width: 100%">
                <tr id="Tr1" runat="server">
                    <td id="Td2" runat="server">
                        <table id="groupPlaceholderContainer" runat="server" border="0" style="width: 100%;">
                            <tr id="groupPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr id="Tr2" runat="server">
                    <td id="Td3" runat="server" style="" align="center">
                        <asp:DataPager ID="DataPager1" runat="server" PageSize="9">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Image" ShowFirstPageButton="True" ShowNextPageButton="False"
                                    ShowPreviousPageButton="False" NextPageImageUrl="~/Images/MoveFirst.png" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False"
                                    ShowPreviousPageButton="False" />
                            </Fields>
                        </asp:DataPager>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
    </asp:ListView>
    <br />
</div>
<asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=EDiamondEntities1"
    DefaultContainerName="EDiamondEntities1" EnableFlattening="False" EntitySetName="SanPhams"
    OrderBy="it.NgayCapNhat DESC" Where="it.[MaLoai] == @id">
    <WhereParameters>
        <asp:QueryStringParameter Name="id" QueryStringField="idLSP" Type="Int32" />
    </WhereParameters>
</asp:EntityDataSource>
<asp:EntityDataSource ID="TatcaLoai" runat="server" ConnectionString="name=EDiamondEntities1"
    DefaultContainerName="EDiamondEntities1" EnableFlattening="False" EntitySetName="SanPhams"
    Where="it.LoaiSanPham.MaNhaSanXuat==@loai">
    <WhereParameters>
        <asp:QueryStringParameter Name="loai" QueryStringField="IDLoai" Type="Int32" />
    </WhereParameters>
</asp:EntityDataSource>
